<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="/pageUtils/template.xhtml">

	<ui:define name="body">
		<h:form prependId="false">
			<div align="left">
				<p:panel header="Cadastro de responsavel" style="whidt:800px;">
					<h:panelGrid columns="1" id="painel" width="100%">

						<h:outputText value="Nome :" style="width:100" />
						<p:inputText id="nome" style="width:500;"
							value="#{responsavelController.responsavel.nome}" maxlength="60"
							title="informe o nome do responsavel" />
						<p:tooltip for="nome" showEvent="focus" hideEvent="blur" />

					</h:panelGrid>
				</p:panel>
				<p:toolbar align="center">
					<p:toolbarGroup align="center">

						<p:commandButton value="Salvar" icon="ui-icon-disk"
							action="#{responsavelController.save()}" update="painelLista" />

						<p:commandButton value="Novo" icon="ui-icon-document"
							action="#{responsavelController.clean()}"
							update="painel,messages" immediate="true" />

						<p:commandButton value="Imprimir" immediate="true"
							icon="ui-icon-print" ajax="false"
							action="#{responsavelController.print()}">
						</p:commandButton>

					</p:toolbarGroup>
				</p:toolbar>
				<h:panelGrid id="painelLista" columns="1">
					<p:dataTable var="listResponsaveis" id="tableLista"
						value="#{responsavelController.responsaveis}" paginator="true"
						rows="5" style="max-width: 800px; min-width: 800px"
						emptyMessage="Nenhum registro.">

						<p:column
							style="max-width: 25px; min-width: 25px; overflow: hidden">
							<f:facet name="header" width="5%">
								<h:outputText value="Codigo" />
							</f:facet>
							<h:outputText value="#{listResponsaveis.id}" />
						</p:column>

						<p:column
							style="max-width: 450px; min-width: 450px; overflow: hidden">
							<f:facet name="header">
								<h:outputText value="Nome" width="95%" />
							</f:facet>
							<h:outputText value="#{listResponsaveis.nome}" />
						</p:column>

						<p:column width="15%">
							<p:commandButton title="Editar" update="painel"
								action="#{responsavelController.editar()}" ajax="false"
								icon="ui-icon-folder-open">
								<f:setPropertyActionListener
									target="#{responsavelController.selected}"
									value="#{listResponsaveis}" />
							</p:commandButton>
						</p:column>

						<p:column>
							<p:commandButton title="Deletar" update="tableLista" ajax="false"
								action="#{responsavelController.remove()}" icon="ui-icon-close">
								<f:setPropertyActionListener
									target="#{responsavelController.selected}"
									value="#{listResponsaveis}" />
							</p:commandButton>
						</p:column>

					</p:dataTable>
				</h:panelGrid>
			</div>
		</h:form>
	</ui:define>
</ui:composition>